import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import * as ElementUI from 'element-ui'
import * as animate from 'animate.css'
import 'element-ui/lib/theme-chalk/index.css'
import './assets/css/all.css'
import VueParticles from 'vue-particles'
import axios from 'axios'
import Axios from 'axios'
import qs from 'qs'
import VueClipboard from 'vue-clipboard2'

Vue.prototype.$axios = Axios
Axios.defaults.baseURL = '/api'
Axios.defaults.headers.post['Content-Type'] = 'application/json';

Vue.use(VueParticles)

Vue.use(ElementUI);
Vue.config.productionTip = false
Vue.use(animate)
Vue.use(VueClipboard)
axios.defaults.baseURL = "http://124.221.200.179/api"
axios.defaults.headers["Content-Type"] = "application/json"
Vue.prototype.$ajax = axios
Vue.prototype.$qs = qs
Vue.prototype.download = (data, fileName) => {
  if (!data) {
    return;
  }
  let url = window.URL.createObjectURL(
      new Blob([data], {type: "application/octet-stream"})
  );

  let link = document.createElement("a");
  link.style.display = "none";
  link.href = url;
  link.setAttribute("download", fileName);

  document.body.appendChild(link);
  link.click();
  document.body.removeChild(link);
  URL.revokeObjectURL(url); // 释放URL 对象
};
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

